package com.sip.dbadapter.dao.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 *
 */
@Entity
@Table(name = "SERVICE_META_DATA")
public class ServiceMetaData implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer serviceTypeId;

    private String name;

    public ServiceMetaData() {

    }

    @Id
    @GeneratedValue
    @Column(name = "TYPE_ID", unique = true, nullable = false)
    public Integer getServiceTypeId() {

        return serviceTypeId;
    }

    @Column(name = "NAME", nullable = true)
    public String getName() {

        return name;
    }

    public void setServiceTypeId(Integer serviceTypeId) {

        this.serviceTypeId = serviceTypeId;
    }

    public void setName(String name) {

        this.name = name;
    }

    @Override
    public int hashCode() {

        int result = 0;
        result = (int) (31 * result + serviceTypeId);
        result = 31 * result + (name != null ? name.hashCode() : 0);

        return result;
    }

    @Override
    public boolean equals(Object other) {

        if (this == other)
            return true;

        if (other == null || (this.getClass() != other.getClass())) {
            return false;
        }

        ServiceMetaData metaData = (ServiceMetaData) other;
        return (this.serviceTypeId == metaData.serviceTypeId) && (this.name != null && name.equals(metaData.name));

    }

}
